#include "RsGisLibCMDFilter.h"


RsGisLibCMDFilter::RsGisLibCMDFilter(RsgisPortal* Port)
{
	ClientPort = Port;

	rsgisFilterGaussianSmooth = NULL;
	rsgisFilterMedian = NULL;
	rsgisFilterMean = NULL;
	rsgisFilterSobel = NULL;
	rsgisFilterPrewitt = NULL;
	rsgisFilterGaussian1stDeriv = NULL;
	rsgisFilterGaussian2ndDeriv = NULL;
	rsgisFilterLaplacian = NULL;
	rsgisFilterLee = NULL;
}

RsGisLibCMDFilter::~RsGisLibCMDFilter()
{
	if (rsgisFilterGaussianSmooth)
		delete(rsgisFilterGaussianSmooth);
	if (rsgisFilterMedian)
		delete(rsgisFilterMedian);
	if (rsgisFilterMean)
		delete(rsgisFilterMean);
	if (rsgisFilterSobel)
		delete(rsgisFilterSobel);
	if (rsgisFilterPrewitt)
		delete(rsgisFilterPrewitt);
	if (rsgisFilterGaussian1stDeriv)
		delete(rsgisFilterGaussian1stDeriv);
	if (rsgisFilterGaussian2ndDeriv)
		delete(rsgisFilterGaussian2ndDeriv);
	if (rsgisFilterLaplacian)
		delete(rsgisFilterLaplacian);
	if (rsgisFilterLee)
		delete(rsgisFilterLee);

	rsgisFilterGaussianSmooth = NULL;
	rsgisFilterMedian = NULL;
	rsgisFilterMean = NULL;
	rsgisFilterSobel = NULL;
	rsgisFilterPrewitt = NULL;
	rsgisFilterGaussian1stDeriv = NULL;
	rsgisFilterGaussian2ndDeriv = NULL;
	rsgisFilterLaplacian = NULL;
	rsgisFilterLee = NULL;
}

void RsGisLibCMDFilter::FilterGaussianSmooth()
{
	rsgisFilterGaussianSmooth = new RsGisLibFilterGaussianSmooth(ClientPort, NULL);
	rsgisFilterGaussianSmooth->show();
}

void RsGisLibCMDFilter::FilterMedian()
{
	rsgisFilterMedian = new RsGisLibFilterMedian(ClientPort, NULL);
	rsgisFilterMedian->show();
}

void RsGisLibCMDFilter::FilterMean()
{
	rsgisFilterMean = new RsGisLibFilterMean(ClientPort, NULL);
	rsgisFilterMean->show();
}

void RsGisLibCMDFilter::FilterSobel()
{
	rsgisFilterSobel = new RsGisLibFilterSobel(ClientPort, NULL);
	rsgisFilterSobel->show();
}

void RsGisLibCMDFilter::FilterPrewitt()
{
	rsgisFilterPrewitt = new RsGisLibFilterPrewitt(ClientPort, NULL);
	rsgisFilterPrewitt->show();
}

void RsGisLibCMDFilter::FilterGaussian1stDeriv()
{
	rsgisFilterGaussian1stDeriv = new RsGisLibFilterGaussian1stDeriv(ClientPort, NULL);
	rsgisFilterGaussian1stDeriv->show();
}

void RsGisLibCMDFilter::FilterGaussian2ndDeriv()
{
	rsgisFilterGaussian2ndDeriv = new RsGisLibFilterGaussian2ndDeriv(ClientPort, NULL);
	rsgisFilterGaussian2ndDeriv->show();
}

void RsGisLibCMDFilter::FilterLaplacian()
{
	rsgisFilterLaplacian = new RsGisLibFilterLaplacian(ClientPort, NULL);
	rsgisFilterLaplacian->show();
}

void RsGisLibCMDFilter::FilterLee()
{
	rsgisFilterLee = new RsGisLibFilterLee(ClientPort, NULL);
	rsgisFilterLee->show();
}
